module MicroEventPerson
  module MicroEventPeopleController
    # GET /micro_event_people
    # GET /micro_event_people.xml
    def index
      @micro_event_people = MicroEventPerson.find(:all)
      
      respond_to do |format|
        format.html # index.html.erb
        format.xml  { render :xml => @micro_event_people }
      end
    end
    
    # GET /micro_event_people/1
    # GET /micro_event_people/1.xml
    def show
      @micro_event_person = MicroEventPerson.find(params[:id])
      
      respond_to do |format|
        format.html # show.html.erb
        format.xml  { render :xml => @micro_event_person }
      end
    end
    
    # GET /micro_event_people/new
    # GET /micro_event_people/new.xml
    def new
      @micro_event_person = MicroEventPerson.new
      
      respond_to do |format|
        format.html # new.html.erb
        format.xml  { render :xml => @micro_event_person }
      end
    end
    
    # GET /micro_event_people/1/edit
    def edit
      @micro_event_person = MicroEventPerson.find(params[:id])
    end
    
    # POST /micro_event_people
    # POST /micro_event_people.xml
    def create
      @micro_event_person = MicroEventPerson.new(params[:micro_event_person])
      
      respond_to do |format|
        if @micro_event_person.save
          flash[:notice] = 'MicroEventPerson was successfully created.'
          format.html { redirect_to(@micro_event_person) }
          format.xml  { render :xml => @micro_event_person, :status => :created, :location => @micro_event_person }
        else
          format.html { render :action => "new" }
          format.xml  { render :xml => @micro_event_person.errors, :status => :unprocessable_entity }
        end
      end
    end
    
    # PUT /micro_event_people/1
    # PUT /micro_event_people/1.xml
    def update
      @micro_event_person = MicroEventPerson.find(params[:id])
      
      respond_to do |format|
        if @micro_event_person.update_attributes(params[:micro_event_person])
          flash[:notice] = 'MicroEventPerson was successfully updated.'
          format.html { redirect_to(@micro_event_person) }
          format.xml  { head :ok }
        else
          format.html { render :action => "edit" }
          format.xml  { render :xml => @micro_event_person.errors, :status => :unprocessable_entity }
        end
      end
    end
    
    # DELETE /micro_event_people/1
    # DELETE /micro_event_people/1.xml
    def destroy
      @micro_event_person = MicroEventPerson.find(params[:id])
      @micro_event_person.destroy
      
      respond_to do |format|
        format.html { redirect_to(micro_event_people_url) }
        format.xml  { head :ok }
      end
    end
  end
end